<template>
    <lightning-card
        title="CompositionContactSearch"
        icon-name="custom:custom57"
    >
        <div class="slds-var-m-around_medium">
            <lightning-input
                type="search"
                onchange={handleKeyChange}
                class="slds-show slds-is-relative slds-var-m-bottom_small"
                label="Search"
            ></lightning-input>
            <template lwc:if={contacts}>
                <template for:each={contacts} for:item="contact">
                    <c-contact-tile
                        class="slds-show slds-is-relative"
                        key={contact.Id}
                        contact={contact}
                    ></c-contact-tile>
                </template>
            </template>
            <template lwc:elseif={error}>
                <c-error-panel errors={error}></c-error-panel>
            </template>
        </div>
        <c-view-source source="lwc/compositionContactSearch" slot="footer">
            Create an experience component by assembling multiple child
            components. Type a few characters in the search bar to experience
            the recipe.
        </c-view-source>
    </lightning-card>
</template>
